package Models::BaseModel;

use DBI qw(:sql_types);
use base 'Catalyst::Model::DBI';

  # __PACKAGE__->config(
    # dsn           => 'ODBC:driver={SQL Server};Server=localhost\SQLEXPRESS',
    # dbname 	  => 'testproject',
    # username      => 'testuser',
    # password      => 'test',
    # options       => { AutoCommit => 1 },
  # );
  our $tablename = "no name"; 
  
  BEGIN {
	 #$dbh = DBI->connect('DBI:mysql:databasename', 'username', 'password') || die "Could not connect to database: $DBI::errstr";
	#$dbh = DBI->connect("dbi:ODBC:driver={SQL Server};Server=localhost\SQLEXPRESS;database=Byggeweb;uid=bohdan;pwd=test;",undef,undef,{ RaiseError => 0, AutoCommit => 0 })
	#		or print "Can`t connect to database";
  }
  
  sub new {
        $self = shift;
        $self{table} = $tablename;
  }

  END {
	#$dbh->disconnect();
  }
  # my $dbh = $c->model('MyModel')->dbh;

  # my $dbh = $self->dbh;

  # my $connection = $c->model('MyModel')->connection;

  # my $connection = $self->connection;

  1;